package com.sina.shop.service.address;

import com.sina.shop.domain.address.Address;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-04-11-10:57
 */
@FeignClient(value = "SHOP-SPRING-CLOUD-ALL", fallback = AddressServiceBack.class)
public interface AddressService {

    @RequestMapping(value = "/address/updateAddress", method = RequestMethod.POST)
    Address updateAddress(@RequestBody(required = false) Address address);

    @RequestMapping(value = "/address/updateAddressNot", method = RequestMethod.POST)
    Integer updateAddressNot(@RequestParam("aid") Long aid);

    @RequestMapping(value = "/address/updateAddressUse", method = RequestMethod.POST)
    Integer updateAddressUse(@RequestParam("id") Long id);

    @RequestMapping(value = "/address/getAddressList", method = RequestMethod.GET)
    List<Address> getAddressList(@RequestParam("adminId") Long adminId);

    @RequestMapping(value = "/address/saveAddress", method = RequestMethod.POST)
    Address saveAddress(@RequestBody(required = false) Address address);

    @RequestMapping(value = "/address/deleteAddress", method = RequestMethod.POST)
    Integer deleteAddress(@RequestParam("id") Long id);
}
